namespace iPhOwa.Exchange.WebDav
{
	/// <summary>
	/// An order by clause
	/// </summary>
	public sealed class OrderBy
	{
		private readonly string propertyName;
		private readonly SortDirection sortDirection;

		/// <summary>
		/// Constructor. Defaults to ascending.
		/// </summary>
		public OrderBy(string propertyName)
		{
			this.propertyName = propertyName;
		}

		/// <summary>
		/// Constructor.
		/// </summary>
		public OrderBy(string propertyName, SortDirection sortDirection)
		{
			this.propertyName = propertyName;
			this.sortDirection = sortDirection;
		}

		/// <summary>
		/// Property to sort by.
		/// </summary>
		public string PropertyName
		{
			get { return propertyName; }
		}

		/// <summary>
		/// Direction to sort.
		/// </summary>
		public SortDirection SortDirection
		{
			get { return sortDirection; }
		}
	}
}